﻿namespace OasisCiq.Xpil
{
    using System;
    using System.Linq;

    /// <summary>
    /// List of information types used for describing a membership
    /// </summary>
    public class MembershipElementList : XS.XSNormalizedString
    {
        private static readonly string[] PossibleValues = new[] 
        {
            "MembershipNumber", // Membership identifier, e.g. membership number or some other type of ID
            "Privilege", // A privilege that the member can enjoy as part of the membership. E.g. access to free events.
            "Restriction", // A restriction that the membership imposes on the member, e.g. do not smoke.
            "GroupName", // Larger group or alliance name the membership provides access to.
            "Category", // Category of the membership such as Gold, Silver, Platinum, etc
            "Type", // Use this if the enumeration list for type of memberhsip is not used.
            "IssuingCountryName", // The country that issues the membership
            "Role" // Role in membership for a person , e.g. secretary, President, treasurer
        };

        public MembershipElementList(string value)
            : base(value)
        {
            if (!PossibleValues.Contains(value))
            {
                throw new ArgumentOutOfRangeException();
            }
        }
    }
}